package annotate.Controller;


import annotate.en.Cache;
import annotate.en.User;

public class UserController {
    private  User[] users = {
            new User("张三"),
            new User("李四"),
            new User("王五"),
            new User("赵六"),
            new User("田七"),
            new User("王八"),
            new User("老九")

    };
    @Cache(key = "user")
    public User getUserById(Integer id){
        System.out.println("查询用户方法被调用。");
        return  users[id];
    }
}
